package loader.models 
{
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import loader.ILoaderModel;
	/**
	 * ...
	 * @author Luke Van In
	 */
	public class LoaderModel extends EventDispatcher implements ILoaderModel
	{
		
		private var _isShowing:Boolean;
		
		private var _progress:Number;
		
		
		
		public function LoaderModel(isShowing:Boolean = false, progress:Number = 0) 
		{
			this._isShowing= isShowing;
			
			this._progress = progress;
		}
		

		
		public function set isShowing(isShowing:Boolean):void 
		{
			if (isShowing == this._isShowing)
				return;
				
			this._isShowing = isShowing;
			
			this.dispatchEvent(new Event(Event.CHANGE));
		}
		
		public function get isShowing():Boolean 
		{
			return this._isShowing;
		}
		
		
		
		public function set progress(progress:Number):void 
		{
			if (progress == this._progress)
				return;
				
			this._progress = progress;
			
			this.dispatchEvent(new Event(Event.CHANGE));
		}
		
		public function get progress():Number 
		{
			return this._progress;
		}
		
		
		
		public function dispose():void
		{
			// nothing to do
		}
		
	}

}